<?php
$this->registerCssFile('@web/css/review.css',['depends'=>['app\assets\AppAsset']]);
?>
<div class="content">
    <div class="container">
        <div class="leadx row clearfix">
            <div class="col-xs-3 pull-left">
                <span>Reading Review</span>
            </div>
            <div class="col-xs-1 pull-right">
            </div>
        </div>
        <div class="review-wrap">
            <div class="review-info row">Reading Review</div>
            <div class="main-wrap">
                <table class="table-review">
                    <tbody>
                    <tr id="table-lead-wrap">
                        <th>#</th>
                        <th>Question</th>
                        <th>Your answer</th>
                    </tr>
                    <?php
                    $session = \Yii::$app->session;
                    $session->open();
                    $answer=$session['read_user_answer'];
                    foreach ($session['read_question'] as $s) {
                        ?>
                        <tr>
                            <td><?=$s['tnum']; ?></td>
                            <td><?= $s['content']; ?></td>
                            <td>
                                <?php
                                if (isset($answer[$s['tnum']]))
                                {
                                    $result='';
                                    if(count($answer[$s['tnum']])<7)//非表格题
                                        foreach ($answer[$s['tnum']] as $i =>$value) {
                                            if($value==2){
                                                $result.=chr($i+65);
                                            }
                                        }
                                    else
                                    {
                                        $result.="A:";
                                        foreach ($answer[$s['tnum']] as $i => $item) if ($item == '1') $result.=chr($i + 65);
                                        $result.="<br>B:";
                                        foreach ($answer[$s['tnum']] as $i => $item) if ($item == '2') $result.=chr($i + 65);
                                    }
                                    echo $result;
                                }
                                else echo'-';
                                ?>
                            </td>
                        </tr>
                        <?php
                    }
                    ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="add-note hidden">
    <div class="row">
        <div class="col-xs-7 text-note">xxxxxxxx</div>
        <div class="col-xs-5 add-note-text">+加到笔记</div>
    </div>
    <div class="row">
        <div class="col-xs-12 add-left">+添加到左侧答案栏</div>
    </div>
</div>